﻿#ifndef SELECTMETHODPAGE_H
#define SELECTMETHODPAGE_H

#include <QWizardPage>
#include <QItemDelegate>

namespace Ui {
class SelectMethodPage;
}

class QStringListModel;

class SelectMethodPage : public QWizardPage
{
    Q_OBJECT

public:
    explicit SelectMethodPage(int selectModulePageID, QWidget *parent = nullptr);
    ~SelectMethodPage();
    const QStringList& getSelectedMethods();

    void initializePage();
    bool isComplete() const;

    QSize sizeHint() const;

public slots:
    void on_pbAdd_clicked();
    void on_pbRemove_clicked();
    void on_pbUp_clicked();
    void on_pbDown_clicked();
    void on_lvMethods_doubleClicked(const QModelIndex& index);
    void on_lvSelectedMethods_doubleClicked(const QModelIndex& index);
    void on_pbDeleteAll_clicked();
    void on_pbAddFull_clicked();

private:
    Ui::SelectMethodPage *ui;

    int selectModulePageID;
    QStringListModel* modelMethods;
    QStringListModel* modelSelectedMethods;
    QStringList methods;
    QStringList selectedMethods;

    class MethodDelegate : public QItemDelegate
    {
        void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;

    };
};

#endif // SELECTMETHODPAGE_H
